package chapter_20_memento.classic_black_box;

/**
 * @author yaochenglong
 * @date 2017/10/24
 */
public class Client {
    public static void main(String[] args) {
        //定义发起者，并设置状态
        Originator originator = new Originator();
        originator.setState("123");

        //定义备忘录管理者，并将第一次的状态存储起来
        CareTaker careTaker = new CareTaker();
        careTaker.setMemento(originator.createMemento());

        //改变状态
        originator.setState("456");
        //恢复状态
        originator.restoreState(careTaker.getMemento());


    }
}
